import {ref,computed} from 'vue';
import {defineStore} from "pinia";
import {getClubsApi, getClubDetailsApi} from '../api/ClubApi.js';
export const useClubStore = defineStore("club", ()=>{
    const clubs = ref([])
    const clubDetails = ref({})

    const getClubs = async () => {
        const response = await getClubsApi()
        clubs.value = response.data
    }
    const getClubDetails = async (id) => {
        const response = await getClubDetailsApi(id)
        clubDetails.value = response.data
    }
    return{
        clubs,
        clubDetails,
        getClubs,
        getClubDetails,
    }
})